import React, { Component } from 'react';
import logo from './logo.svg';
import './App.css';
import { connect } from './myselfredux/connect';
import { doTest } from './useredux/testCreateStore';
import QueueAnim from 'rc-queue-anim';

class App extends Component {
  componentWillReceiveProps(props){
    if(props.num === 0 && !this.fg){
      props.doTest();
      this.fg = 1;
      console.log(props);
    }

    console.log(props);
  }
  render() {
    return (
      
      <div className="App">
        <header className="App-header">
          <img src={logo} className="App-logo" alt="logo" />
          <h1 className="App-title">Welcome to React</h1>
        </header>
        <QueueAnim delay={1000}>
        <p key={'admin'} className="App-intro">
          To get started, edit <code>src/App.js</code> and save to reload.
        </p>
        </QueueAnim>
      </div>
      
    );
  }
}
App = connect(
  state => ({num: state}),
  {doTest}
)(App);
export default App;
